package com.zhongfl.crm.service.boss;


import com.zhongfl.crm.enums.boss.WorkOrderTypeCode;
import com.zhongfl.crm.model.boss.RxWorkOrderCompleted;
import com.zhongfl.crm.model.boss.ServiceResult;
import com.zhongfl.crm.model.boss.WorkOrder;

import java.util.List;

/**
 * 工单管理
 * Created by wangkun23 on 2018/5/03.
 */
public interface WorkOrderService {

    /**
     * 根据工单号查询
     *
     * @param workOrderNo
     * @return
     */
    WorkOrder findByWorkOrderNo(String workOrderNo);

    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @return
     */
    List<WorkOrder> findByOrderNo(String orderNo);

    /**
     * 指派工单
     *
     * @param workOrderNo
     * @param assigneeStaffCode
     * @param claimAmibaId
     * @param claimStaffCode
     * @param remark
     * @param createBy
     * @return
     */
    void assignee(String workOrderNo,
                  String assigneeStaffCode,
                  Integer claimAmibaId,
                  String claimStaffCode,
                  String remark,
                  String createBy);

    /**
     * 已结算
     *
     * @param workOrderNo
     */
    void settled(String workOrderNo);

    /**
     * 取消工单
     *
     * @param workOrderNo
     * @return
     */
    void cancel(String workOrderNo, String currentName);

    /**
     * 更新工单
     *
     * @param workOrder
     */
    void update(WorkOrder workOrder);

    /**
     * 工单创建
     *
     * @param orderNo
     * @param workOrderTypeCode
     * @param remark
     * @param createBy
     * @return
     */
    ServiceResult<String> create(String orderNo,
                                 String createStaffCode,
                                 WorkOrderTypeCode workOrderTypeCode,
                                 String remark,
                                 String createBy,
                                 Integer receiveAmibaId);

    /**
     * 完成工单
     *
     * @param completedInfo
     * @return
     */
    void complete(RxWorkOrderCompleted completedInfo);
}
